<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layout :: common_header(~{::title})">
    <title>库存管理-商品列表</title>
</head>
<body th:replace="layout :: common_body(~{::div.layui-body})">

<div class="layui-body" style="padding:15px;top: 0px;">
    <div class="layui-form-item">
        <label class="layui-form-label">输入旧密码</label>
        <div class="layui-input-inline">
            <input type="text" name="oldPwd" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">输入新密码</label>
        <div class="layui-input-inline">
            <input type="password" name="newPwd" placeholder="请输入密码" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">再次输入新密码</label>
        <div class="layui-input-inline">
            <input type="password" name="repPwd" placeholder="请输入密码" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="button" id="upd_pwd" class="layui-btn" lay-submit lay-filter="demo1">立即提交</button>
        </div>
    </div>
    <script type="text/javascript">
        $(function () {
            $('#upd_pwd').click(function (e) {
                data = {
                    oldPwd: $("input[name='oldPwd']").val(),
                    newPwd: $("input[name='newPwd']").val(),
                    repPwd: $("input[name='repPwd']").val()
                }
                $.ajax({
                    url: '/ajax_wms_user/upd_wms_manage_user_pwd',
                    type: "POST",
                    dataType: 'json',
                    contentType: 'application/json',
                    data: JSON.stringify(data),
                    success: function (res) {
                        if (res.code == 0) {
                            location.href = '/exit';
                        } else {
                            alert(res.msg);
                        }
                    }
                });
            });
        });
    </script>
</div>
</body>
</html>
